package martin.tpfinal.reconocer;


/**
 * Utilidad para resolver que Sistema Operativo corre debajo de la aplicacion.
 *
 */
public final class OSvalidator {
	
	private static final String OS_NAME = "os.name";
	
	private static final String WIN = "win";
	private static final String MAC = "mac";
	private static final String UNIX = "nix";
	private static final String LINUX = "nux";
	private static final String SOLARIS = "sun";
	
	public static boolean isWindows(){
		 
		String os = System.getProperty(OS_NAME).toLowerCase();
		//windows
	    return (os.indexOf( WIN ) >= 0); 
	
	}

	public static boolean isMac(){
	
		String os = System.getProperty(OS_NAME).toLowerCase();
		//Mac
	    return (os.indexOf( MAC ) >= 0); 
	
	}

	public static boolean isUnix(){
	
		String os = System.getProperty(OS_NAME).toLowerCase();
		//linux or unix
	    return (os.indexOf( UNIX ) >=0 || os.indexOf( LINUX ) >=0 || os.indexOf( SOLARIS ) >= 0);
	
	}

}
